package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ya
 * @date 2023/8/2 11:05
 * @desciption: 订单明细持久层
 */
@Mapper
public interface OrderDetailMapper {
    /**
     * 向订单明细表批量插入数据
     * @param orderDetailList
     */
    void insertBatch(List<OrderDetail> orderDetailList);

    /**
     * 根据订单id查询订单详细信息
     * @param orderId
     * @return
     */
    @Select("select * from order_detail where order_id = #{orderId};")
    List<OrderDetail> getByOrderId(Long orderId);
}
